<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title></title>
</head>

<body>
  <canvas id="webgpu"></canvas>
  <script>
    let main = async () => {
      let worker = new Worker("./src/worker/Main.js");

      const canvas = document.querySelector("#webgpu");
      const gpuContext = canvas.getContext('gpupresent');

      let adaper = await navigator.gpu.requestAdapter();

      let device = await adaper.requestDevice();

      console.log(
        self.crossOriginIsolated
      )

      worker.postMessage({
        device: device
      });
    }

    window.addEventListener('DOMContentLoaded', main);
  </script>
</body>

</html>